

<html><head>
	<title>Connect with Facebook</title>
	<style>
		body {
			margin:50px 0px; padding:0px; /* Need to set body margin and padding to get consistency between browsers. */
			text-align:center; /* Hack for IE5/Win */
			background-color:#000;
		    color: #333333;
		    direction: ltr;
		    font-family: "lucida grande",tahoma,verdana,arial,sans-serif;
		    font-size: 11px;
		}
		#footer {
			height: 80px;	
		}
		.content {
			width:600px;
			margin:0px auto; /* Right and left margin widths set to "auto" */
			text-align:left; /* Counteract to IE5/Win Hack */
			padding:15px;
			border:1px solid #333;
			background-color:white;
		}
		.error {
			border: 1px solid red;
			margin-top: 10px;
			padding: 20px;
		}
		h2 {
		    line-height: 20px;
		    min-height: 20px;
		    padding-bottom: 2px;
		    vertical-align: bottom;
			color: #1C2A47;
    		font-size: 16px;
		}
		a {
			color: #3B5998;
		    cursor: pointer;
		    text-decoration: none;
		}
		.messages {
		    padding: 15px;
		    background-color: #cdc;
		    list-style: none;
		}
	</style>
	
	<link href="{{ STATIC_URL }}css/facebook.css" type="text/css" rel="stylesheet" media="all" />
	
</head><body>

<div>



<div class="content">
	<h2>Django Facebook - Test page</h2>
	<p>By Thierry Schellenbach
		<a href="http://www.mellowmorning.com/">mellowmorning.com</a>, <a href="http://twitter.com/tschellenbach">@tschellenbach</a>
	</p>
</div>
<div class="content" style="margin-top: 10px;">
	{% if request.GET.fb_error_or_cancel or request.GET.error %}
		<div class="error">
			Please click allow in the facebook interface, to access Fashiolista
		</div>
	{% endif %}
	
	<div class="error" id="django_static_error">
		Couldn't load the static Javascript files, is django static configured correctly?
		<a href="http://docs.djangoproject.com/en/1.3/howto/static-files/" target="_blank">See the docs here.</a>
	</div>
    {% if messages %}
    <ul class="messages">
        {% for message in messages %}
        <li{% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message }}</li>
        {% endfor %}
    </ul>
    {% endif %}
    
	<div style="margin-top: 60px;">
        <div class="inner_content">
        	
			<!--form to call registration via facebook -->
            <form action="{% url facebook_connect %}?facebook_login=1" method="post">
	            <h2>Register, login or connect with facebook</h2>
				<input type="hidden" value="{{ request.path }}" name="next" />
				
				<!--
				use error next for a seperate error page
				<input type="hidden" value="/error/" name="error_next" />
				-->
				
				<iframe src="http://www.facebook.com/plugins/facepile.php?app_id={{ FACEBOOK_APP_ID }}&amp;width=500&amp;max_rows=1" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:500px; height:80px;" allowTransparency="true"></iframe>
				<input onclick="F.connect(this.parentNode); return false;" type="image" src="http://e.fashiocdn.com/images/b_signin_facebook_small.png" /> (javascript popup)
				<br /><br />
				<input type="image" src="http://e.fashiocdn.com/images/b_signin_facebook_small.png" /> (redirect version)
	        </form>
			
			
        </div>
	</div>
	
	<div id="footer">
		<div>
		{% if request.user.is_authenticated %}
			Hello {{ request.user }}, <a href="{% url django.contrib.auth.views.logout %}?next={{ request.path|urlencode }}">logout</a>
		{% else %}
			You are not logged in, Please login by clicking one of the buttons above
		{% endif %}
		</div>
        <div style="float: right;">
	        <form action="{% url facebook_connect %}?facebook_login=1" method="post">
	            <a href="javascript:void(0);" onclick="F.connect(this.parentNode);">Test fresh registration</a>
				<input type="hidden" value="{{ request.path }}" name="next" />
				<input type="hidden" value="1" name="force_registration_hard" />
	        </form>
	        <form action="{% url facebook_connect %}?facebook_login=1" method="post">
	            <a href="javascript:void(0);" onclick="F.connect(this.parentNode);">Test registration</a>
				<input type="hidden" value="{{ request.path }}" name="next" />
				<input type="hidden" value="1" name="force_registration" />
	        </form>
		</div>
	</div>

    <div id="image_upload" style="margin: 60px 0px 20px 0px;">
        <h2>Album upload flow</h2>
        <div>
            <form action="{% url facebook_image_upload %}" method="get">
                {% csrf_token %}
                <input type="hidden" value="{{ request.path }}" name="next" />
                
                <img src="http://e.fashiocdn.com/images/entities/0/7/z/0/D/0.126x126.jpg" alt="image"/>
                <input type="hidden" value="http://e.fashiocdn.com/images/entities/0/7/z/0/D/0.365x365.jpg" name="pictures" />
                
                <img src="http://d.fashiocdn.com/images/entities/0/6/T/p/8/0.126x126.jpg" alt="image"/>
                <input type="hidden" value="http://d.fashiocdn.com/images/entities/0/6/T/p/8/0.365x365.jpg" name="pictures" />
                <br />

                <input type="submit" value="Upload to your album" />
            </form>
        </div>
    </div>

    <div id="wall_post" style="margin: 60px 0px 20px 0px;">
        <h2>Post to My Wall</h2>
        <div>
            <form action="{% url facebook_wall_post %}" method="get">
                {% csrf_token %}
                <input type="hidden" value="{{ request.path }}" name="next" />

                <textarea name="message" rows="3" cols="35">Check out fashiolista.com, loving it :)</textarea>
                <br />
                <input type="submit" value="Post to your wall" />
            </form>
        </div>
    </div>

    <div id="wall_post" style="margin: 60px 0px 20px 0px;">
        <h2>Post to My Wall - Javascript Popup version</h2>
        <div>
            <form action="{% url facebook_wall_post %}" method="post">
                {% csrf_token %}
                <input type="hidden" value="{{ request.path }}" name="next" />

                <textarea name="message" rows="3" cols="35">Check out fashiolista.com, loving it :)</textarea>
                <br />
                <input type="submit" value="Post to your wall" onclick="F.connect(this.parentNode, ['publish_stream']); return false;"/>
            </form>
        </div>
    </div>
	
	
</div>

<script src="/static/js/statictest.js" type="text/javascript"></script>

{% include 'django_facebook/_facebook_js.html' %}

</div>
</body></html>